package edu.ustb.services.weatherforecast.contract;

import edu.ustb.sc.definitions.SpescContractTerm;

public enum ContractTermEnum {
    Term1("ServiceTerm3_1", new ServiceTerm3_1()),
    Term2("ServiceTerm3_2", new ServiceTerm3_2());

    public String termName;
    public SpescContractTerm SpescTerm;

    ContractTermEnum(String termName, SpescContractTerm contractTerm) {
        this.termName = termName;
        this.SpescTerm = contractTerm;
    }

    public static ContractTermEnum match(String termName) {
        ContractTermEnum[] values = ContractTermEnum.values();
        for (ContractTermEnum value : values) {
            if (value.termName.equals(termName)) {
                return value;	// find first
            }
        }
        return null;
    }

    public String getTermName() {
        return termName;
    }

    public SpescContractTerm getSpescTerm() {
        return SpescTerm;
    }
}
